﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Bll.Base;
using Watchdog.Bll.Factory;

namespace Watchdog.Bll {

    public partial class Notification : NotificationBase {

        internal Notification () : base () {}

        internal Notification ( Facade.Notification notification ) : base (notification) { }
		
		#region [ Parent objects ]


		#endregion

		#region [ Many to many relations ]

		List<Test> tests;
		public List<Test> Tests {
			get {
				if ( tests == null )
					tests = TestFactory.GetByNotification(this.Id);
				return tests;
			}
		}

		#endregion

		#region [ Add & Remove methods for many to many relations ]

		public void AddTest (Test test) {
			NotificationFactory.AddTest (this, test);
			//reset the collection;
			tests = null;
		}

		public void RemoveTest (Test test) {
			NotificationFactory.RemoveTest (this, test);
			//reset the collection;
			tests = null;
		}

		#endregion
		
		#region [ One to many relations ]

		#endregion
		
		#region [ Add & Remove methods for one to many relations ]

		#endregion

    }
}
